Skip to content

full frame background themes + transparency toggle - #30

Merged
Blankeos merged 2 commits into
mainfrom
feat/full-frame-bg-themes
Aug 25, 2026
Merged

full frame background themes + transparency toggle#30
Blankeos merged 2 commits into
mainfrom
feat/full-frame-bg-themes

Conversation

@Blankeos

@Blankeos Blankeos commented Aug 25, 2026

Copy link
Copy Markdown
Owner
  • Add theme appearance metadata (dark/light) during theme generation and persist per-theme appearance for dialog filtering and dark-mode defaults.
  • Solidify imported/generated theme backgrounds by replacing transparent/semi-transparent values with opaque colors to keep default canvas rendering consistent.
  • Add /themes runtime background transparency toggle (ctrl+t) with persisted user preference and dialog state rollback/commit handling. - Sync app rendering to Color::Reset/opaque canvas behavior and derive theme mode from selected theme appearance for correct light/dark slot usage.
image image image image image

…ggle

- Add theme appearance metadata (`dark`/`light`) during theme generation and persist per-theme appearance for dialog filtering and dark-mode defaults. - Solidify imported/generated theme backgrounds by replacing transparent/semi-transparent values with opaque colors to keep default canvas rendering consistent. - Add `/themes` runtime background transparency toggle (`ctrl+t`) with persisted user preference and dialog state rollback/commit handling. - Sync app rendering to `Color::Reset`/opaque canvas behavior and derive theme mode from selected theme appearance for correct light/dark slot usage.
…hemes

Dual-mode themes that declare distinct dark/light palettes now emit a `{id}-light.json` sibling with `appearance: "light"` so the `/themes` selector can filter and pick the light palette independently. Fake dual-modes (identical dark↔light values) are skipped. The gen-themes script also auto-updates `BUNDLED_THEMES` in `src/theme.rs`.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@Blankeos

Copy link
Copy Markdown
Owner Author

PR Review — feat/full-frame-bg-themes → main

Merge confidence: 5/5

No open GitHub PR for this branch (gh pr view returned none). Reviewed feat/full-frame-bg-themes (e17071c) against origin/main.

Body (paste-ready)

Solidifies theme backgrounds by default (OpenCode-style full-frame canvas), adds per-theme appearance (dark/light) with luminance inference + searchable filter in /themes, and introduces a persisted ctrl+t transparency toggle so the terminal bg can show through when desired. Theme JSON/codegen (scripts/gen-themes.ts) strips transparent/#rrggbbaa backgrounds at generate time; runtime transparency is opt-in only. Transparency persists immediately on toggle (Esc does not roll it back — intentional).

Summary of changes

Area What
scripts/gen-themes.ts solidifyBackground, ensureAppearance, #rgba/#rrggbbaa parsing
src/theme.rs ThemeAppearance, get_colors_with(dark, transparent), alpha hex parse
src/themes/* + src/generated_themes/* Mass regen (~200 files) with solid bg + appearance
src/app.rs Full-frame solid canvas fill; preview restores dark_mode from appearance; transparency state
src/views/themes_dialog.rs ctrl+tToggleTransparent; search matches appearance
src/persistence/prefs.rs theme_transparent key get/set
src/views/chat.rs, home.rs Spacer blocks use theme bg (no unpainted holes)
_docs/config/theme.mdx Appearance + transparency docs

Checks run (non-mutating)

Check Result
cargo check --bin crabcode
cargo test --bin crabcode theme:: ✅ 7/7
cargo test --bin crabcode themes_dialog ✅ 4/4
cargo test --bin crabcode persistence::prefs::tests ✅ 9/9
cargo test --bin crabcode views::chat:: ✅ 26/26
cargo test --bin crabcode question_dialog ❌ 9 fail — unrelated (see note below)
cargo clippy --bin crabcode -- -D warnings ❌ 117 errors, mostly unrelated files (sessions_dialog, storage_dialog, …)

question_dialog note: those 9 tests call Theme::load_from_file("src/theme.json"), but src/theme.json does not exist on this branch (or typically). Panic is Os { kind: NotFound }. File is not in this PR’s diff — pre-existing flaky tests (other tests in the same file already use load_builtin_default()). Ignore for merge.

Regressions?

No blocking regressions. Confirmed intentional:

  1. Esc does not roll back transparency — by design. ctrl+t persists immediately via apply_theme_transparent; only theme index + dark_mode restore on cancel. Docs note preference is persisted; Esc cancels theme preview, not the transparency pref.

Lower risk / worth watching:

  1. dark_mode forced from theme appearance on startup — can override a user’s prior dark/light expectation when restoring a light theme. Intentional per commit message, but UX change.
  2. No test_theme_transparent_round_trip in prefs (unlike active_theme / compact_mode).
  3. Large generated-theme churn — hard to spot a bad solidify fallback by eye; unit tests cover parse + a few builtins only.

Migrations?

No schema migration required.

  • Prefs are a string key/value table (prefs / set_pref).
  • New key: "theme_transparent" ("true" / "false"), default false when missing.
  • src/persistence/migrations.rs is unchanged.
  • Existing DBs keep working; first toggle writes the new key.

Checklist before merge

  • Manual smoke: light/dark + transparent on/off + restart — done by author, works
  • question_dialog failures confirmed unrelated (src/theme.json missing; not in this diff)
  • Add persistence::prefs round-trip test for theme_transparent (nice-to-have only)
  • Open the PR (gh pr create) if you want CI on the remote

Confidence bumps

Author smoke + intentional ctrl+t persist + confirmed unrelated test noise → 5/5.

Optional polish Score stays
Prefs theme_transparent round-trip test still 5/5 (coverage nicety)
Fix question_dialog to use load_builtin_default() (separate PR) still 5/5

@Blankeos
Blankeos merged commit 51bcdb7 into main Aug 25, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant